﻿using System;
using System.Text;
using System.IO;
using System.Collections;
using System.Collections.Generic;

//namespace Tssipl.PaymentAdapter.Core
//{
    public static class ExtensionMethods
    {        
        public static int WordCount(this String str)
        {
            return str.Split(new char[] { ' ', '.', '?' }, StringSplitOptions.RemoveEmptyEntries).Length;
        }
        /// <summary>
        /// This method returns a new string that will contain a substring of original string starting from the index passed as first argument up to one less than the second argument of the method i.e. from beginIndex to (endIndex-1).
        /// </summary>
        /// <param name="str"></param>
        /// <param name="startIndex"></param>
        /// <param name="endIndex"></param>
        /// <returns></returns>
        public static string SubstringJava(this String str, int startIndex, int endIndex)
        {
            return str.Substring(startIndex, endIndex - startIndex);
        }
        public static string Substring(this String str, int startIndex, int length, ref int indexCounter)
        {
            
            string strNew =str.Substring(startIndex, length);
            indexCounter += length;
            return strNew;
        }
    }

//}